import request from '@/utils/request'
import qs from 'qs'

// /permission/queryPermissionTree 查询权限列表树
export const queryPermissionTree = params => {
  return request({
    url: '/permission/queryPermissionTree',
    method: 'GET',
    params
  })
}

// /permission/page 查询
export const menuPage = data => {
  return request({
    url: '/permission/page?' + qs.stringify(data),
    method: 'POST'
  })
}

// /permission/save 新增 / 修改菜单
export const saveMenu = data => {
  return request({
    url: '/permission/save',
    method: 'POST',
    data
  })
}

// /permission/delete 删除菜单
export const deleteMenu = data => {
  return request({
    url: '/permission/delete?' + qs.stringify(data),
    method: 'POST'
  })
}
